package Core;

public class Engine {
	public Gdi Gdi;
	
	public View CurrentView;
	
	private GameThread _thread;
	
	public void Init(Gdi gdi){
		this.Gdi = gdi;
	}
	
	public void Start(){
		_thread = new GameThread(this);
		_thread.isRunning = true;
		_thread.start();
	}
	
	public void Stop(){
		if(this._thread != null){
			this._thread.isRunning = false;
			this._thread.interrupt();
			//this._thread.w
			this._thread = null;
		}
	}
	
	public void switchView(View view){
		if(this.CurrentView != null){
			this.CurrentView.switchView(view);
		} else {
			this.CurrentView = view;
		}
	}
}
